package com.example.demo.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.demo.pojo.TbBrand;
import com.example.demo.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.bind.DefaultValue;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/brand")
public class BrandController {
    @Autowired
    private BrandService brandService;

    @RequestMapping("/findList")
    public List<TbBrand> findList(){
        return brandService.findAll();
    }


    @RequestMapping("/page/{num}/{size}/{firstC}")
    public IPage<TbBrand> findPageByFirstChar(@PathVariable("num") Long num
            , @PathVariable("size") Long size, @PathVariable("firstC")String firstC){

        return brandService.findPageByFirstChar(num,size,firstC);

    }
}
